home *** CD-ROM | disk | FTP | other *** search
-
- Optimised QuickSort of ARRAY OF signed LONG ( qsortSL.m )
-
- © Richard Perrott 4th April 1995 FreeWare
- email: hcm94rp2@dmu.ac.uk
-
-
- This is a module containing a heavily optimised Quicksort routine
- for ARRAY OF LONG ( signed values ), it sort the array in accending
- order.
-
- There are 3 ways to call the routine:
-
- 1.
- by direct machine code access to the core routine,
- pass two registers to it.
-
- A0 = the start address of array
- A1 = the end address of array
-
- BSR qsortSL_mc
-
- or
-
- JSR qsortSL_mc
-
-
- 2.
- by calling a PROC with the start and end address
- of the array.
-
- PROC qsortSL(first_p,last_p)
-
- 3.
- by calling a PROC with the base address of array,
- a start index and an end index.
-
- PROC qsortSLi(base_p,first,last)
-
-
- Note:
- All 3 methods save any registers they use, the only exception is
- A0 and A1 for qsortSL_mc.
-
- The module contains 184 bytes of assembler / E code.
-
- The routine has been heavily tested, though there are no promises
- and I won't be held responsible if you find bugs or you misuse the
- routines.
-
- If you do find any bugs then please email me.
-
- References:
- Programming and Problem Solving in Modula-2, Sanford Leestma
- & Larry Nyhoff, © Macmillan 1992, USA, page 624-626
-
- ( beware the example in this book for Split() contains some bugs )
-